# Contributor: Anjandev Momi <anjan@momi.ca>
# Maintainer: Anjandev Momi <anjan@momi.ca>
pkgname=py3-ecos
pkgver=2.0.11
pkgrel=4
pkgdesc="python interface for ECOS"
url="https://github.com/embotech/ecos-python"
arch="all"
license="GPL-3.0-only"
depends="py3-numpy py3-scipy ecos"
makedepends="py3-setuptools ecos-dev py3-numpy-dev python3-dev py3-gpep517"
checkdepends="py3-nose"
subpackages="$pkgname-pyc"
source="ecos-python-$pkgver.tar.gz::https://github.com/embotech/ecos-python/archive/refs/tags/v$pkgver.tar.gz
	use_external_ecos.patch
	assertEquals.patch
	"
builddir="$srcdir/ecos-python-$pkgver"

build() {
	make version
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	.testenv/bin/python3 -m nose
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

sha512sums="
30ee09ca02f8b2c4b308917f766bd82df62e78737f3a4f7490c89add45473606c1aad431073445d47e488553a8f34642e680c5c98b034c56df15033d3a298180  ecos-python-2.0.11.tar.gz
671bea0c1eadf6fe67a632af6598bc1bc48fbe2ddbdc4439f6bcc52636a9a5b43e7f1c5b7a384a737088a16f69ca3835048b562eeb4c6894a52f381d759ec6c9  use_external_ecos.patch
1d25d4583aa0cb5031238aa49df03cec3a5e31c262c4b6c6657bd51149afa0194331c91c8a7fbb36413f0fb518ec0876ceedfcc0bb5a207497b9128183290b81  assertEquals.patch
"
